package com.metier;

import java.io.Serializable;


/**
 * This is an object that contains data related to the contact table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="contact"
 */

public abstract class BaseContact  implements Serializable {

	public static String REF = "Contact";
	public static String PROP_FK_CONTEXTE = "FkContexte";
	public static String PROP_ID = "Id";


	// constructors
	public BaseContact () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseContact (com.metier.ContactPK id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseContact (
		com.metier.ContactPK id,
		com.metier.Contexte fkContexte) {

		this.setId(id);
		this.setFkContexte(fkContexte);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private com.metier.ContactPK id;

	// many to one
	private com.metier.Contexte fkContexte;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     */
	public com.metier.ContactPK getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (com.metier.ContactPK id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: fk_contexte
	 */
	public com.metier.Contexte getFkContexte () {
		return fkContexte;
	}

	/**
	 * Set the value related to the column: fk_contexte
	 * @param fkContexte the fk_contexte value
	 */
	public void setFkContexte (com.metier.Contexte fkContexte) {
		this.fkContexte = fkContexte;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.metier.Contact)) return false;
		else {
			com.metier.Contact contact = (com.metier.Contact) obj;
			if (null == this.getId() || null == contact.getId()) return false;
			else return (this.getId().equals(contact.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

}